<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            position: relative;
            /* margin: 0 auto; */
            /* height: 70px; */
            width: 300px;
            background-color: rgba(0, 0, 0, 0.3);
            padding: 10px;

        }

        input {
            padding: 10px 20px;
            width: 260px;
            border: none;
        }

        img {
            position: absolute;
            top: 14px;
            left: 262px;
        }

        p {
            margin-top: 0;
            margin-bottom: 5px;
            color: red;
            font-size: 15px;
        }
    </style>
</head>

<body>
    <div id="d1">
        <input type="text" placeholder="请输入用户名">
        <img src="http://doc.canglaoshi.org/tstore_v1/images/login/yhm.png" alt="">
        <p>用户名不能为空</p>
    </div>

</body>

</html>